package com.ychen.core.remote;

import com.google.common.collect.Lists;
import com.ychen.api.DemoService;
import com.ychen.api.dto.CourseDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @author chenyuliao
 * @version 1.0
 * @description
 * @date 2020/12/12 15:03
 */
@DubboService
@Slf4j
public class DemoServiceImpl implements DemoService {
    @Override
    public String sayHello(String name) {
        return "I am server,Hello " + name;
    }


    @Override
    public List<CourseDto> getCourseList(String id) {
        // 模拟查询数据库
        System.out.println("服务器正在查询数据...");
//            TimeUnit.SECONDS.sleep(1);
        System.out.println("数据已查询结束...");
        return Lists.newArrayList();

    }
}
